package com.ktjiaotu.example.example12and17;

/**
 * @Author: DABINGCHNEGJIAO
 * @CreateTime: 2025-06-06
 * @Description:
 * @Version: 1.0
 */

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * 水果颜色注解
 */

@Target(FIELD)
@Retention(RUNTIME)
@Documented
public @interface FruitColor {
    /**
     * 颜色枚举
     */
    public enum Color {
        BLUE, RED, GREEN;

        @Override
        public String toString() {
            return name().toLowerCase();
        }
    }

    /**
     * 颜色属性
     */
    Color fruitColor() default Color.GREEN;
}
